package com.hex.liyue.usermodule.presenter;

import com.hex.liyue.commonmodule.manager.HttpManager;
import com.hex.liyue.commonmodule.manager.UserManager;
import com.hex.liyue.commonmodule.net.ResponseListener;
import com.hex.liyue.usermodule.bean.MyWalletResultbean;

/**
 * Created by WJ on 2016/6/26.
 */
public class WalletPresenter {
    private IWalletView iWalletView;

    public WalletPresenter(IWalletView iWalletView) {
        this.iWalletView = iWalletView;
    }

    public void getWallet(int page, int page_num) {
        iWalletView.showLod("加载中...");
        HttpManager.getInstance().user_getWallet(UserManager.getUserId(), page, page_num, new ResponseListener<MyWalletResultbean>() {
            @Override
            public void onSuccess(MyWalletResultbean myWalletResultbean) {
                iWalletView.closeLod();
                iWalletView.setAdapter(myWalletResultbean);
            }

            @Override
            public void onFailure(String responseresult) {
                iWalletView.closeLod();
                iWalletView.showT(responseresult);
            }
        });
    }
}
